package core.semantics.util;

import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;

public class SpecificContext {

	private List<Variable> variables;

	public SpecificContext() {
		this.variables = new LinkedList<Variable>();
	}

	public void addVariable(Variable var) {
		this.variables.add(var);
	}
	
	public Variable getVariable(String varName) {
		for (Variable var : variables) {
			if (var.getName().equals(varName)) {
				return var;
			}
		}
		
		return null;
	}
	
	public List<Variable> getVariables() {
		return variables;
	}

	@Override
	public String toString() {
		return Arrays.toString(variables.toArray());
	}
	
}
